package com.dq.utils;

import java.applet.Applet;
import java.applet.AudioClip;
import java.net.URL;

public class PlayMusicUtil {
	
	private static AudioClip bgmAudio;
	
	public static  void playBGM(){
		//获取音乐文件的路径
		URL url = PlayMusicUtil.class.getResource("../music/bgm.wav");
		//创建声音剪辑对象
		bgmAudio = Applet.newAudioClip(url);
		//播放声音即可
		bgmAudio.loop();
	}
}
